package edu.sctu.java.basic.array;

public class UserManager {

    User[] users = new User[0];

    void addUser(User user) {

        User[] results = new User[users.length + 1];
        for (int i = 0; i < users.length; i++) {
            results[i] = users[i];
        }
        results[users.length] = user;
        users = results;
    }

    void print() {

        for (User u : users) {
            System.out.println(u.name);
        }
    }

}
